{% extends "cms/base.html" %}

{% block title -%}
  添加员工
{%- endblock %}

{% block head %}
{% endblock %}

{% block page_title -%}
  {{ self.title() }}
{%- endblock %}

{% block main_content %}
  <form action="{{ url_for('cms.staff_add') }}" method="post">
  <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
    <div class="form-container">
      <div class="form-group form-inline">
        <label for="email">邮箱：</label>
        <input id="email" type="email" class="form-control" name="email" placeholder="邮箱">
      </div>
      <div class="form-group">
        <label>角色：</label>
          {% for role in roles %}
        <div class="form-check form-check-inline">
          <input class="form-check-input" type="radio" name="role" id="inlineRadio{{ loop.index }}" value="{{ role.id }}">
          <label class="form-check-label" for="inlineRadio{{ loop.index }}">{{ role.name }}</label>
        </div>
          {% endfor %}
        </div>
      </div>
     {% with messages = get_flashed_messages()%}
        {% if messages %}
            <div class="form-group">
                <ul>
                    {% for message in messages %}
                        <li class="text-danger">{{ message }}</li>
                    {% endfor %}
                </ul>
            </div>
        {% endif %}
        {% endwith %}
      <div class="form-group">
        <button class="btn btn-primary" id="submit">立即添加</button>
      </div>
  </form>
{% endblock %}